<template>
  <div class="comparison">
    <Dialog content="按照该vip客户落地区县的收入纬度，分析统计资产落地该区县的vip客户收入环比上升情况"></Dialog>
    <div class="table">
      <!-- <el-table border style="width: 100%" :header-cell-style="{
                    background: '#0070C0',
                    color: '#ffffff'
                }" :data="tableData">
        <el-table-column label="环比上升客户TOP100(省政企)" prop="city" align="center">
          <el-table-column label="客户名" prop="custName" align="center"></el-table-column>
          <el-table-column label="环比上升(万元)" prop="hb" align="center">
            <template slot-scope="scope">
              <span v-if="scope.row.hb < 0" style="color:red;">{{
                                scope.row.hb
                            }}</span>
              <span v-else>{{ scope.row.hb }}</span>
            </template>
          </el-table-column>
        </el-table-column>
      </el-table>
      <el-table border style="width: 100%" :header-cell-style="{
                    background: '#0070C0',
                    color: '#ffffff'
                }" :data="tableData1">
        <el-table-column label="环比上升客户TOP100(市政企)" prop="province" align="center">
          <el-table-column label="客户名" prop="custName" align="center"></el-table-column>
          <el-table-column label="环比上升(万元)" prop="hb" align="center">
            <template slot-scope="scope">
              <span v-if="scope.row.hb < 0" style="color:red;">{{
                                scope.row.hb
                            }}</span>
              <span v-else>{{ scope.row.hb }}</span>
            </template>
          </el-table-column>
        </el-table-column>
      </el-table> -->
      <el-table border style="width: 100%" :header-cell-style="{
                    background: '#0070C0',
                    color: '#ffffff'
                }" :data="tableData2">
        <el-table-column label="环比上升客户TOP100" prop="management" align="center">
          <el-table-column label="客户名" prop="custName" align="center"></el-table-column>
          <el-table-column label="VIP归属" prop="vipNbr" align="center"></el-table-column>
          <el-table-column label="环比上升(万元)" prop="hb" align="center">
            <template slot-scope="scope">
              <span v-if="scope.row.hb < 0" style="color:red;">{{
                                scope.row.hb
                            }}</span>
              <span v-else>{{ scope.row.hb }}</span>
            </template>
          </el-table-column>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
// import { customer } from "@/api/barCode/index";
import $barCodeApi from "@/api/barCode/index";
import Dialog from './dialog.vue'
export default {
  name: "comparison",
  components: {
      Dialog
  },
  props: {
    form: {
      type: Object,
      default: {}
    }
  },
  data () {
    return {
      tableData: [],
      tableData1: [],
      tableData2: []
    };
  },
  created () { },
  mounted () { },
  methods: {
    getList () {
      // customer({
      //   acctMonth: this.form.acctMonth,
      //   type: '1'
      // }).then((res) => {
      //   if (res.code == 0) {
      //     this.tableData = res.data.city;
      //     this.tableData1 = res.data.province;
      //     this.tableData2 = res.data.management;
      //   }
      // });

      $barCodeApi.customer(
        {
          acctMonth: this.form.acctMonth,
          areaId: this.form.areaId,
          type: "1"
        },
        res => {
          if (res.code == 0) {
            this.tableData2 = res.content.city;
            // this.tableData1 = res.data.province;
            // this.tableData2 = res.data.management;
          }
        }
      );
    }
  }
};
</script>

<style scoped lang="scss">
.table {
  display: flex;
}
</style>
